package com.example.activiti.controller;

import com.example.activiti.common.core.domain.AjaxResult;
import com.example.activiti.domain.dto.ActivitiHighLineDTO;
import com.example.activiti.service.IActivitiHistoryService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;


/**
 * @author Administrator
 */
@RestController
@RequestMapping("/activitiHistory")
public class ActivitiHistoryController {

    @Resource
    private IActivitiHistoryService activitiHistoryService;

    /**
     * 1.根据instanceId获取流程图高亮数据
     *
     * @param instanceId 流程实例ID
     * @return 高亮对象
     */
    @GetMapping("/getHighLine")
    public AjaxResult getHighLine(@RequestParam("instanceId") String instanceId) {
        ActivitiHighLineDTO activitiHighLineDTO = activitiHistoryService.getHighLine(instanceId);
        return AjaxResult.success(activitiHighLineDTO);
    }

}
